﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ManageTeams.aspx.cs" Inherits="TsWeb.Sports.ManageTeams" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
     <ul>
<div class="accordion" id="accordion2">
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <li class="nav-header" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                            Gestión de equipos</li>
                    </div>
                    <div id="collapseOne" class="collapse in">
                        <div class="accordion-inner">
                            <h6>
                                Crear un nuevo equipo</h6>
                                <asp:Button ID="ButtonCreateTeam" runat="server" Text="Nuevo equipo" OnClick="ButtonCreateTeam_Click"  CssClass="btn-success right"           />
                            
                        </div>
                    </div>
                    </ul>



</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/jquery-1.9.1.js" />
            <asp:ScriptReference Path="~/Scripts/bootstrap.min.js" />
              <asp:ScriptReference Path="~/Scripts/uploadfile.js" />
        </Scripts>
    </asp:ScriptManager>
     



    <p>
    </p>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
    
     <Triggers>
            <asp:PostBackTrigger ControlID="UserButton" />
            <asp:PostBackTrigger ControlID="InsertCommentButton" />
            
        </Triggers>
        <ContentTemplate>
           
            <asp:GridView ID="TeamsGrid" runat="server" AutoGenerateColumns="False" CssClass="table table-hover table-striped" GridLines="None" OnRowCommand="TeamsGrid_RowCommand">
                <Columns>
                    <asp:BoundField DataField="TeamId" ControlStyle-CssClass="hidden" HeaderStyle-CssClass="hidden"
                        ItemStyle-CssClass="hidden" />
                    <asp:ImageField DataImageUrlField="Image" AlternateText="Imagen del equipo" ControlStyle-CssClass="imageSize" ControlStyle-Height="60px" ControlStyle-Width="60px" />
                    <asp:BoundField DataField="Name" HeaderText="Nombre" />
                    <asp:ButtonField ButtonType="Link" CommandName="CommentCommand" Text="Comentar" />
                    <asp:ButtonField ButtonType="Link" CommandName="EditCommand" Text="Editar" />
                    <asp:ButtonField ButtonType="Link" CommandName="DeleteCommand" Text="Eliminar" />
                </Columns>
                <RowStyle CssClass="cursor-pointer" />
            </asp:GridView>
               <p>
            </p>
         
            <p>
            </p>
        
          
         


             <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                aria-hidden="true">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×</button>
                    <h3 id="myModalLabel">
                        <img runat="server" id="TeamLogo" class="img-rounded" alt="Logo del equipo" align="middle" /></h3>
                </div>
                <div class="modal-body">
                   
                      <p>
                            <img runat="server" alt="" src="" style="display: none;" id="Img1" class="imageSize" />
                        </p>
                        <p>
                            &nbsp;<ajaxToolkit:AsyncFileUpload ID="AsyncFileUpload1" runat="server" ploaderStyle="Modern"
                                Width="275px" ThrobberID="lbluploadprogress" OnUploadedComplete="AsyncFileUpload1_UploadedComplete"
                                UploadingBackColor="#66CCFF" />
                            <p>
                                <asp:Label ID="lbluploadprogress" runat="server" Style="color: #FF3300" Text="Upload in progress..." />
                                <p>
                                </p>
                                <p>
                                    <asp:Label ID="TeamNameLabel" runat="server" AssociatedControlID="TeamNameTxt">Nombre:</asp:Label>
                                    <asp:TextBox ID="TeamNameTxt" runat="server" CssClass="textEntry"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="TeamNameRequired" runat="server" ControlToValidate="TeamNameTxt"
                                        CssClass="failureNotification" ErrorMessage="El equipo debe tener un nombre."
                                        ToolTip="Nombre del equipo" ValidationGroup="MangeTeamSummaryValidationGroup">*</asp:RequiredFieldValidator>
                                </p>
                                <p>
                                    <asp:Label ID="SportNameLabel" runat="server" AssociatedControlID="SportComboBox">Deporte al que pertence:</asp:Label>
                                    <asp:DropDownList ID="SportComboBox" runat="server" DataTextField="Name"
                                        DataValueField="SportId">
                                    </asp:DropDownList>
                                </p>
                                <p>
                                  
                              
                                    



                </div>
                <div class="modal-footer">
                    
                    <asp:Button ID="UserButton" runat="server" Text="Actualizar equipo" CssClass="btn btn-primary"
                        OnClick="UpdateTeamButton_Click" />
                </div>
            </div>

            <!-- Modal para ingreso de comentarios-->
           <div id="ModalComentarios" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                aria-hidden="true">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×</button>
                    <h3 id="H1">
                        Nuevo comentario</h3>
                </div>
            <div class="modal-body">
                    <p>
                                 &nbsp;<asp:ListView ID="ListViewComments" runat="server" 
                                        >
                                        <ItemTemplate>
                                            <div class="alert alert-info">
                                                <span class="label label-info">
                                                    <%#Eval("CmtDate") %></span> &nbsp;&nbsp;&nbsp;&nbsp;
                                                <%#Eval("Text") %>
                                            </div>
                                        </ItemTemplate>
                                        <EmptyDataTemplate>
                                            Aún no hay comentarios
                                        </EmptyDataTemplate>
                                      
                                    </asp:ListView>
                        <span class="failureNotification">
                            <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                        </span>
                </div>
                <div class="modal-footer">
                <form class="form-inline">                         
                <asp:TextBox ID="TeamCommentTextBox" CssClass="input-medium" runat="server">Ingrese un comentario</asp:TextBox>
                <asp:Button ID="InsertCommentButton" runat="server" CommandName="AddComment" CssClass="btn btn-primary"
                                                    Text="Comentar" OnClick="CommentTeamButton_Click" />
                    </form>

                </div>
            </div>



        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
